# Rspack Plugin

:::info Note
Requires Rspack version 0.5.0 or above.
:::

- Capable of building modules that meet the `Module Federation` loading specifications.
- Can consume modules that adhere to the `Module Federation` specifications using aliases.
- Can set shared dependency configurations for modules, so that when the host environment of the loaded module already has the corresponding dependency, it will not be loaded again.
- When a module has remote types, it will automatically download and consume the types of the remote modules.
- Consuming remote modules will have hot update capabilities.

{props.tip}

## Quick Start

### Installation

You can install the plugin with the following commands:

import { PackageManagerTabs } from '@theme';

<PackageManagerTabs
  command={{
    npm: `npm add ${props.pkgName || '@module-federation/enhanced'}`,
    yarn: `yarn add ${props.pkgName || '@module-federation/enhanced'}`,
    pnpm: `pnpm add ${props.pkgName || '@module-federation/enhanced'}`,
    bun: `bun add ${props.pkgName || '@module-federation/enhanced'}`,
  }}
/>

### Create {props.configName || 'module-federation.config.ts'}

Create the {props.configName || 'module-federation.config.ts'} file with the following content:

import CreateConfig from '@components/common/rspack/create-config';

{props.createConfig || <CreateConfig />}

### Register Plugin

In `Rspack`, you can add plugins through the `plugins` configuration item:

import RegisterPlugin from '@components/common/rspack/register-plugin';

{props.registerPlugin || <RegisterPlugin />}

## Configuration

You can find detailed descriptions of all configuration items on the [Config Overview](../../configure/index) page.
